#ifndef __MEDIAPARSER_H__
#define __MEDIAPARSER_H__

extern "C" {
#include <libavformat/avformat.h>
};

namespace MParser {

class mediaparser {
    const char   *filename;
    AVFormatContext *fmt_ctx;
    AVDictionary    *format_opts;  

    int m_nStreamNum;
public:
    mediaparser(const char *filename);
    ~mediaparser();
    int open();
    int parse();
    int close();
    int getDuration();
    const char* getFormat();

    // Stream info
    int getStreamsInfo();

    // Audio Section
    const char* getAudioCodec();
    int getAudioBitRate();

    // Video Section
    const char* getVideoCodec();
    int getVideoBitRate();
    int getVideoResolution(int *w, int *h);
};

};

#endif //__MEDIAPARSER_H__

